<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/bootstrap/css/bootstrap.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/font-awesome/css/font-awesome.min.css">
    <!-- Custom Font Icons CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/font.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/custom.css">
    <title>会议系统</title>

</head>
<body>
<%@include file="public_jsp/header.jsp" %>

<div class="d-flex align-items-stretch">
    <!-- Sidebar Navigation-->
    <%@include file="public_jsp/sidebar.jsp" %>
    <!-- Sidebar Navigation end-->
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">会议系统</h2>
            </div>
        </div>

        <section class="no-padding-bottom">

            <div class="list-group myList">
                <!--搜索文章的条件-->
                <div class="myTitle">
                    <form class="form-inline " method="post"
                          action="${pageContext.request.contextPath}/meeting/meetingList">
                        <div class="form-group">
                            <label for="inlineFormInput" class="sr-only">Name</label>
                            <c:if test="${requestScope.title == null}">
                                <input id="inlineFormInput" type="text" placeholder="按标题名字查找"
                                       class="mr-sm-3 form-control" name="title">
                            </c:if>
                            <c:if test="${requestScope.title != null}">
                                <input id="inlineFormInput" type="text" placeholder="按标题名字查找"
                                       value="${requestScope.title}" class="mr-sm-3 form-control" name="title">
                            </c:if>
                        </div>
                        <div class="form-group">
                            <input type="submit" value="查询" class="btn btn-primary">
                        </div>
                        <!--选择部门-->
                        <div class="form-group">
                            <select name="dep" class="form-control">
                                <option>请选择部门</option>
                                <c:forEach items="${sessionScope.deptList}" var="dept">
                                    <option>${dept.name}</option>
                                </c:forEach>
                                <%--<option>电邀部</option>--%>
                                <%--<option>推广部</option>--%>
                            </select>
                        </div>
                    </form>

                    <input id="addMeet" type="submit" value="发布会议" class="btn btn-primary">


                </div>

                <ul>
                    <c:forEach items="${requestScope.meetingList}" var="meet">
                        <li class="list-group-item">
                            <div style="float: right;">
                                <span><strong>状态：</strong>${meet.status}</span>
                            </div>
                            <a href="${pageContext.request.contextPath}/view/meetingDetail?meetingId=${meet.id}">${meet.title}</a>
                            <p class="h6"><strong>部门：</strong>${meet.deptName}</p>
                            <p class="h6"><strong>日期：</strong>${meet.publishDate}</p>
                            <p style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis">
                                    ${meet.content}
                            </p>
                        </li>
                    </c:forEach>

                    <%--<li class="list-group-item">--%>
                        <%--<div style="float: right;">--%>
                            <%--<span><strong>状态：</strong>正在进行</span>--%>
                        <%--</div>--%>
                        <%--<a href="meeting_detail.jsp">关于《小标交友》项目部分模块功能升级</a>--%>
                        <%--<p class="h6"><strong>部门：</strong>研发部</p>--%>
                        <%--<p class="h6"><strong>日期：</strong>2019-10-30</p>--%>
                        <%--<p style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis">--%>
                            <%--小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：--%>
                            <%--小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：--%>
                            <%--小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：--%>
                            <%--小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级：小标交友有如下模块需要升级</p>--%>
                    <%--</li>--%>

                </ul>

                <nav class="text-center" aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <c:forEach end="${requestScope.totalPage}" begin="1" step="1" varStatus="i">
                            <li><a href="${pageContext.request.contextPath}/view/meeting?current=${i.count}&title=${requestScope.title}&dep=${requestScope.dep}">${i.count}</a></li>
                        </c:forEach>

                        <%--<li><a href="#">2</a></li>--%>
                        <%--<li><a href="#">3</a></li>--%>
                        <%--<li><a href="#">4</a></li>--%>
                        <%--<li><a href="#">5</a></li>--%>
                        <li>
                            <a href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </section>

        <%@include file="public_jsp/foot.jsp" %>
    </div>
</div>

<!-- JavaScript files-->
<script src="${pageContext.request.contextPath}/assets/vendor/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/popper.js/umd/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery.cookie/jquery.cookie.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/chart.js/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery-validation/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/charts-home.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/front.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/custom.js"></script>


<script>

    $(function () {
        var contextPath = $("#contextPath").val();
        var userId = $("#userId").val();

        $("#addMeet").click(function () {
            window.location.href = contextPath+'/view/meetingAdd'
        });

    })
</script>
</body>
</html>